package com.daniel.cms.controller;

import com.daniel.cms.entity.UserEntity;
import com.daniel.cms.service.UserService;
import com.daniel.cms.utils.ResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * 详细说明
 *
 * @author Daniel
 * @version V1.0
 * @date 2020/4/21 10:38
 */
@Api(tags = "测试管理")
@RequestMapping("/account")
@RestController
public class UserController {
	@Autowired
	UserService service;

	@ApiOperation("新增用户")
	@ApiImplicitParams(value = {@ApiImplicitParam(name = "entity", dataType = "AccountEntity", value = "用户实体")})
	@PostMapping("/create")
	public ResultVO create(@Valid @RequestBody UserEntity entity) {
		return service.create(entity);
	}
}
